<?php require('header.php') ?>

<?php if (isset($username)):?>
	<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=<?=$GOOGLE_KEY?>" type="text/javascript"></script>
	<script src="<?=$JAVASCRIPT_DIR?>stats_map.js" type="text/javascript"></script>

	<script type="text/javascript">
		document.observe("dom:loaded", function() {
		// initially hide all containers for tab content
			initialize_user_map('<?=$username?>');
		});
	</script>

<?php endif; ?>

<?php require('nav.php') ?>		

<?php // if logged in already, show user page
	if (isset($username)):
		require('user_page.php'); ?>	

<?php // if not logged in already, show login page
	else: ?>
	<div class="box span-6 last">
		<form action='login_new.php' method='POST'>
			<?php if (isset($_REQUEST['requested_url'])){ ?>
			<input type="hidden" name="requested_url" id="requested_url" value="<?php echo $_REQUEST['requested_url'] ?>" >
			<?php } ?>
			<div class="span-3">
				<label for="username">Username:</label>
			</div>
			<div class="span-3 last">
				<input type="text" name="username" id="username" size="10" value=" username  " onfocus="if(this.value==' username  '){this.value='';}" >
			</div>

			<div class="span-3">
				<label for="password">Password:</label>
			</div>
			<div class="span-3 last">
				<input type="password" name="password" id="password" size="10" value="  password  " onfocus="if(this.value=='  password  '){this.value='';}">
			</div>

			<hr />

			<div class="span-6 last">
				<input type="submit" name="submit" id="submit" value="Login">
			</div>
		</form>
	</div>
<?php endif ?>

<?php require('footer.php');
